"""mydjango URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,re_path
from django.views.static import serve
from myapp.views import myindex,MyView,delete_data
from myapp.md_user import RegisterView,MyCode,Login,WeiboLogin\
    ,DingDingLogin,UploadFile,ChangePassword,QiuNiu,UserInfo
from myapp.md_pics import InsertPics
from myapp.md_goods import InsertGoods,CateView,GoodsList,GetTags,GoodsShow,InsertTags\
    ,GetOnLine,InsertComment,CommentList,UidFlow,GidFlow,GetFlow,userisflow,GoodsClick\
    ,GoodsRank,GoodsSearch
# from myapp.kaoshi import KaoshiRegister,KaoshiLogin,KaoshiDingDing_back

urlpatterns = [
    #定义超链接路由
    re_path('^static/upload/(?P<path>.*)$',serve,{'document_root':'/static/upload/'}),
    path('',MyView.as_view()),
    path("delete_data/",delete_data),     #删除用户接口


    path('register/',RegisterView.as_view()),   #注册接口
    path('mycode/',MyCode.as_view()),        # 验证码接口
    path('login/',Login.as_view()),         #登录接口
    path('weibo_back/',WeiboLogin.as_view()),   #微博回调
    path('dingding_back/',DingDingLogin.as_view()),  #钉钉回调
    path('uploadfile/',UploadFile.as_view()) ,   #上传文件
    path('changepassword/',ChangePassword),    #修改密码
    path('qiniu/',QiuNiu.as_view()),     #七牛token
    path('userinfo/',UserInfo.as_view()),    #个人用户信息
    path('insertpics/',InsertPics.as_view()),  #插入幻灯片和展示
    path('insertgoods/',InsertGoods.as_view()),  #插入goods
    path('cate/',CateView.as_view()),  # 分类展示
    path('goodslist/',GoodsList.as_view()),  # 商品分页展示
    path('goods/',GoodsShow.as_view()),  # 单个商品展示
    path('inserttags/',InsertTags.as_view()),  # 添加标签
    path('gettags/',GetTags.as_view()),  # 获取标签
    path('getonline/',GetOnLine.as_view()),    #在线人数
    path('insertcomment/',InsertComment.as_view()),    #添加评论
    path('commentlist/',CommentList.as_view()),    #评论展示
    path('uidflow/',UidFlow.as_view()),   #查询用户的商品
    path('gidflow/',GidFlow.as_view()),   #查询商品关注的用户
    path('getflow/',GetFlow.as_view()),   #获取关注人数
    path('userisflow/',userisflow),   #当前是否登录
    path("goodsclick/",GoodsClick.as_view()),   # 商品点击
    path("goodsrank/",GoodsRank.as_view()),     #商品点击榜
    path('goodsearch/',GoodsSearch.as_view()),  #goods检索


    # 考试
    # path('reg/',KaoshiRegister.as_view()),
    # path('log/',KaoshiLogin.as_view()),
    # path('dingding_back/',KaoshiDingDing_back.as_view())

]
